<extend name="public@base5"/>
<block name="main">
    <div class="wrap js-check-wrap">
        <form method="post" class="js-ajax-form">
            <table class="table table-hover table-bordered table-list">
                <thead>
                <tr>
                    <th>{:lang('File Name')}</th>
                    <th>{:lang('Controller Action')}</th>
                    <th>{:lang('File Path')}</th>
                    <th>{:lang('Description')}</th>
                    <th width="60">{:lang('ACTIONS')}</th>
                </tr>
                </thead>
                <tbody>
                <foreach name="files" item="vo">
                    <tr>
                        <td>{$vo.name}</td>
                        <td>{$vo.action}</td>
                        <td>{$vo.file}.html</td>
                        <td>{$vo.description}</td>
                        <td>
                            <a class="btn btn-xs btn-primary"
                               href="javascript:;"
                               data-file="{$vo.id}"
                               data-title="{$vo.name} {$vo.file}.html"
                               onclick="openDesignDialog(this)"
                               title="{:lang('Design')}" data-toggle="tooltip">
                                <i class="fa fa-paint-brush fa-fw"></i>
                            </a>
                        </td>
                    </tr>
                </foreach>
                </tbody>
            </table>
        </form>
    </div>
</block>
<block name="scripts">
    <script>
        function openDesignDialog(obj) {
            var $obj = $(obj);
            var fileId = $obj.data('file');
            var title = $obj.data('title');
            parent.openIframeLayer("{:url('Theme/fileSetting')}?file_id=" + fileId, title, {
                area: GV.IS_MOBILE ? ['100%', '100%'] : ['600px', '100%'],
                offset: GV.IS_MOBILE ? ['0px', '0px'] : 'auto',
                btn: ["{:lang('OK')}", "{:lang('CANCEL')}"],
                yes: function (index, layero) {
                    var iframeWin = parent.window[layero.find('iframe')[0]['name']];
                    iframeWin.confirm();
                    //layer.close(index); //如果设定了yes回调，需进行手工关闭
                }
            });
        }
    </script>
</block>
